﻿	      <?php include("conn.php");
             mysql_query('SET NAMES UTF8'); 

	  

class MyPrizeBean
{
	
	public $images;
	public $name;
	public $addtime;
	public $service;
	public $content;
	
	function __construct($images,$name,$addtime,$service,$content)
	{
		
		$this->images      = $images;
		$this->name      = $name;
		$this->addtime      = $addtime;
		$this->service      = $service;
		$this->content      = $content;
	
	}
}

if($_REQUEST['page']!="")
{
$de=$_REQUEST['page']*$_REQUEST['pagesize'];
$size=$_REQUEST['pagesize'];
}

else
{
$de=0;
$size=5;
}




   $rert31=mysql_query("select *from goodsreply where shopid='".$_REQUEST[shopid]."' order by goodsreplyid desc limit $de,$size ");
  $prize = array();
 while($rowf=mysql_fetch_array($rert31)){

  
     $rert32=mysql_query("select *from user where userid='".$rowf[userid]."'");
     $rowf3=mysql_fetch_array($rert32);


   if($rowf['service']<2)
						   {
						   $pinfen="<span></span>";
						   }
						   
						   else   if($rowf['service']<3)
						   {
						   $pinfen="<span></span><span></span>";
						   }
						    else   if($rowf['service']<4)
						   {
						  $pinfen="<span></span><span></span><span></span>";
						   }
						    else   if($rowf['service']<5)
						   {
						  $pinfen="<span></span><span></span><span></span><span></span>";
						   }
						   else  {
						  $pinfen="<span></span><span></span><span></span><span></span><span></span>";
						   }


$de = array();
$de=explode(" " ,$rowf[addtime]);
$shijians=$de[0];

   
		$prize[] = new MyPrizeBean($rowf3['images'],$rowf3['niname'],$shijians,$pinfen,$rowf['content']);
		

}
echo json_encode($prize);


?>